<?
    include "./common.php";
    $username = $_POST['username'];
    $pwd = $_POST['pwd'];
    $sql = "SELECT * FROM users WHERE userName = '{$username}' AND pass_word = '{$pwd}'";
    $res = mysqli_query($link,$sql);
    // echo $sql;
    $arr = [] ;
    if( $one = mysqli_fetch_assoc($res) ){
        // mysqli_fetch_assoc
        $arr['status'] = 1 ;
        $arr['info'] = "正在登录"; 
        $arr['id'] = $one['id'];
        $arr['ulevel'] = $one['ulevel'];
    } else {
        $arr['status'] = 0 ;
        $arr['info'] = "用户名或密码不正确"; 
    }
    echo json_encode($arr);
?>